//
//  XWXSqliteQueryCommand+Query.h
//  XWXSqlite
//
//  Created by 许卫星 on 17/9/5.
//  Copyright © 2017年 wxxu. All rights reserved.
//

#import "XWXSqliteQueryCommand.h"

@interface XWXSqliteQueryCommand (Query)

//select语句 columList=nil SELECT *
//是否去重
- (XWXSqliteQueryCommand *)select:(NSString *)columList isDistinct:(BOOL)isDistinct;

//去哪个表格，可以是多个表格
- (XWXSqliteQueryCommand *)from:(NSString *)fromList;

//查询条件
- (XWXSqliteQueryCommand *)where:(NSString *)condition;
//查询条件
- (XWXSqliteQueryCommand *)whereColumnName:(NSString *)name relation:(ColumnNameToValueRelationType)relationType value:(id)value valueType:(ColumnValueRelationType)valueType;

//ORDER BY 语句用于根据指定的列对结果集进行排序
- (XWXSqliteQueryCommand *)orderBy:(NSString *)orderBy isDESC:(BOOL)isDESC;

//取几条数据
- (XWXSqliteQueryCommand *)limit:(NSInteger)limit;

//从第几条开始取
- (XWXSqliteQueryCommand *)offset:(NSInteger)offset;

//从offset开始取limit条数据
- (XWXSqliteQueryCommand *)limit:(NSInteger)limit offset:(NSInteger)offset;

//取纪录总条数
- (XWXSqliteQueryCommand *)countAll;

//拿到最新插入行的记录ID
- (NSNumber *)lastInsertRowId;
//最近执行的INSERT、UPDATE和DELETE语句所影响的数据行数
- (NSNumber *)rowsChanged;

@end
